<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <link rel="shortcut icon" href="../../src/images/bitbug_favicon.ico" type="image/x-icon">
  <meta name="keywords" content="your keywords">
  <meta name="description" content="your description">
  <meta name="author" content="author,email address">
  <meta name="robots" content="index,follow">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="renderer" content="ie-stand">
  <title>仁和区党群服务一号通暨群众意见受理中心</title>
  <link rel="stylesheet" href="../../src/css/base.css">
  <link rel="stylesheet" href="../../src/css/common.css">
  <link rel="stylesheet" href="../../src/css/tpl.css">
  <link rel="stylesheet" href="../../src/css/user_center.css">
    <script src="../../src/js/libs/es5-shim.min.js"></script>   <script src="../../src/js/libs/es5-sham.min.js"></script>    <script src="../../src/js/libs/json3.min.js"></script> </head>

<body>
  <div class="page">
    <div id="header">
    </div>
    <div class="menu-bar">
      <div class="container">
        <span>
        <span class="crumb-name">当前你的位置：</span>>
        </span>
        <span>
             <a href="../Home/Index.html">首页</a>>
      </span>
        <span>个人中心</span>
      </div>
    </div>
    <div class="mid_container clearfix">
      <div class="left_guide">
        <h1 class="left_guide_top_size">
          个人中心
        </h1>
        <div class="left_guide_decorate">
        </div>
        <div class="left_about_us">
          ABOUT US
        </div>
        <div class="left_white_about active">
          <a href="../Personal/LeaveMessage.html">
              <span class="left_cn_about_us">系统消息</span>
            </a>
        </div>
        <div class="left_white_about">
          <a href="../Personal/Collect.html">
              <span class="left_cn_about_us">我的收藏</span>
            </a>
        </div>
        <div class="left_white_about">
          <a href="../Personal/Work.html">
              <span class="left_cn_about_us">我的工作</span>
            </a>
        </div>
        <div class="left_white_about">
          <a href="../Personal/set.html">
              <span class="left_cn_about_us">修改密码</span>
            </a>
        </div>
      </div>
      <div class="mid_guide">
        <div class="mid_guide_content tabs">
          <div class="title">
            <div class="tab-item">
              <ul>
                <li class="active" typeid="0">系统消息</li>
                <li typeid="1">留言消息</li>
              </ul>
            </div>
          </div>
          <div class="uc-item-msg">
            <ul id="system_html">

            </ul>
          </div>
          <div class="loadmore"><span class="js_loadmore">查看更多▼</span></div>
        </div>
      </div>
    </div>
  </div>
  </div>
  <div id="footer"></div>
  <script type="text/html" id="system_tpl">
    {{each resultdata val idx}}
    <li>
      <div class="item clearfix">
        <div class="item-l fl">
          <img src="../../src/images/p_3.png">
        </div>
        <div class="item-r">
          <div class="row-1">
            <span class="title">{{val.TITLE}}</span><span class="date">{{val.CREATE_TIME}}</span>
          </div>
          <div class="row-2">
            {{val.CONTENT}}
          </div>
        </div>
      </div>
    </li>
    {{/each}} {{if count === 0}}
    <div class="empty_box">
      <img src="../../src/images/null_state.png" alt="">
    </div>
    {{/if}}
  </script>
  <script src="../../src/js/libs/jquery.1.12.4.js"></script>
  <script src="../../src/js/libs/template-web.js"></script>
  <script src="../../src/js/base/common.js"></script>
  <script>
    var params = {
      page: 1,
      userid: document.cookie.split(";")[1].split("=")[1],
      url: '/api/ow/Tidings/GetTidingsDs',
      totalpage: null
    }
    var pageindex = 6

    $('.tab-item li').on('click', function (res) {
      var type = $(this).attr('typeid')
      type == '0' ? params.url = '/api/ow/Tidings/GetTidingsDs' : params.url =
        '/api/ow/LeaveMessage/GetLeaveMessageCondition'
      $(this).addClass('active').siblings().removeClass('active')
      getList(params)
    })

    $('.js_loadmore').on('click', function () {
      params.page++;
      if (params.page === params.totalpage) {
        $(this).text('没有更多了')
      }
      getList(params)
    })

    getList(params)

    function getList(params) {
      $.ajax({
        url: 'http://renheapp.sczmgk.com:5680' + params.url,
        type: "POST",
        dataType: "json",
        data: {
          "PageNo": params.page,
          "PageSize": 5,
          "Condition": 1,
          "KeyWord": params.userid
        },
        success: function (res) {
          res.resultdata = JSON.parse(res.resultdata)
          res.count = JSON.parse(res.count)[0].count
          params.totalpage = Math.ceil(res.count / 5)
          if (res.count == 0) {
            $('.loadmore').hide()
          }
          var system = template('system_tpl', res)
          $('#system_html').append(system)


        },
        error: function () {
          $('#system_html').html('')
          $('.loadmore').hide()
        }
      })
    }
  </script>
</body>

</html>